//停车记录 - 静态 路由
import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
import type { ResultTable } from "./result/result_table";

const basePath = "white_list/";

//白名单列表
export const whiteList = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "list"), {
    data
  });
};

//新增白名单
export const whiteListAdd = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "add"), {
    data
  });
};

//移除白名单
export const whiteListDelete = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "delete"), {
    data
  });
};

const downRequest = (endpoint, data = {}) => {
  return http.request("post", baseUrlApi(basePath + endpoint), {
    data,
    responseType: "blob" // 指定响应类型为 Blob
  });
};

export const download = (data?: object) => downRequest("download", data);
